package br.ufrn.engcomp.domain;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.Socket;

public class ClientWorker implements Runnable {

	Parser parser = new ParserImpl();

	private Socket client;

	ClientWorker(Socket client) {
		this.client = client;
	}

	@Override
	public void run() {
		BufferedReader input = null;
		BufferedWriter output = null;
		try {
			input = new BufferedReader(new InputStreamReader(
					client.getInputStream()));
			output = new BufferedWriter(new OutputStreamWriter(
					client.getOutputStream()));

			output.write(("HTTP/1.1 200 OK\n\nClientWorker: " + System
					.currentTimeMillis()));

			output.close();
			input.close();
		} catch (IOException e) {
			System.out.println("in or out failed");
			System.exit(-1);
		}

	}

}
